<%-- 
  - Author: Neha Chauhan
  - Date: 13-Apr-2011
  - Copyright Notice: TRAKHEES
  - Description: edit.jsp
 --%>

<%@ include file="/WEB-INF/view/include.jsp"%>
<%@ page import="ae.pcfc.etks.online.web.*"%>

<script type="text/javascript">
	$().ready(function() {
		
		//$("input:submit, input:reset, input:button, input:file").button();
		
		$("#EditRegisteredPersonUser").validate({
			onfocusout:false,
			onkeyup:false,
			//onclick: false,			
			rules : {
				strClientPersonNameENG  : "required",
				strClientPersonNameARB  : "required",
				strUserName : "required",
				strEmailAddress : "required",
				strPassword : "required",
				strConfirmPassword : {required:true,equalTo: "#strPassword"},
				iSecretQuestion : "required",
				strSecretAnswer : "required",
				strMobileNo : "required"
				
			},
			showErrors : function(errorMap, errorList) {

				var errors = '<ul>';
				var label;
				if (errorList.length) {
					$.each(errorMap, function(name, value) {
						label = $("label[for='" + name + "']").html();
						label = value + '[' + label + ']';
						errors = errors + '<li>' + label + '</li>';

					});
					errors = errors + '</ul>';
					jAlert('error', errors, '<spring:message code="label.errormessage" />');
				}
			}

		});

	});
	
	$(function() {			
		$( "#accordion" ).accordion();	
		$( "#accordion1" ).accordion();	
});
</script>


<div id="container" dir='<spring:message code="page.dir"/>'  align='<spring:message code="page.align"/>'>

	<div class="ui-jqgrid-titlebar ui-widget-header ui-corner-top ui-helper-clearfix"><spring:message code="label.menu.update.user.profile" /></div>
	<div id=accordion  class="t_fin-black-txt">
		
		<fieldset>
		<legend>
		<spring:message code="label.client.summary.info" />
		</legend>
		</fieldset>
		<div class="t_form-left">
			<div class="fm-req"><label>
				<spring:message code="label.nonclient.person.register.nameENG" />
				</label> 
				<input
						disabled="disabled"
						value='<c:out value="${clientPersonSummary.strNameENG}"></c:out>'>
							
			</div>
			<div class="fm-req"><label>
					<spring:message code="label.nonclient.person.register.nameARB" />
				</label> 
				<input
						disabled="disabled"
						value='<c:out value="${clientPersonSummary.strNameARB}"></c:out>'>
						
			</div>
			<div class="fm-req">
					<label> <spring:message code="label.client.trakheesID" /> </label>
					<input
						disabled="disabled"
						value='<c:out value="${clientPersonSummary.strTrakheesId}"></c:out>'>
				</div>
			<div><label>
				<spring:message code="label.nonclient.person.register.telNoHome" />
				</label>
				<input
						disabled="disabled"
						value='<c:out value="${clientPersonSummary.strHomeTel}"></c:out>'>
							
			</div>
			<div class="fm-req"><label>
				<spring:message code="label.company.role" />
				</label>	
				<select multiple="multiple" style="float: none;" disabled="disabled">
				<c:forEach items="${clientPersonSummary.SCClientPersonRoleVO}" var="clientRole" varStatus="loop">
					<c:if test="${loop.index > 0}">
						<c:out value=""></c:out>
					</c:if>
					<c:choose>
						<c:when	test='${requestScope.requestContextAttribute.locale.language == "ar"}'>
							<option><c:out value="${clientRole.clientRoleArb}"></c:out></option>
						</c:when>
						<c:otherwise>
							<option><c:out value="${clientRole.clientRoleEng}"></c:out></option>
						</c:otherwise>
					</c:choose>		
						 
				</c:forEach>
				</select>	
			</div>
			<div class="fm-req"><label>
				<spring:message code="label.nonclient.person.register.mobNo1" />
				</label>
				<input
						disabled="disabled"
						value='<c:out value="${clientPersonSummary.strMobile1}"></c:out>'>
							
			</div>
			
			<div><label>
				<spring:message code="label.nonclient.person.register.emailAddress" />
				</label>
				<input
						disabled="disabled"
						value='<c:out value="${clientPersonSummary.strEmail}"></c:out>'>
							
			</div>
			
			<div><label>
				<spring:message code="label.nonclient.person.register.websiteURL" />
				</label>
				<input
						disabled="disabled"
						value='<c:out value="${clientPersonSummary.strWebsite}"></c:out>'>
							
			</div>
		</div>
	</div>

	<form:form name="EditRegisteredPersonUser" id="EditRegisteredPersonUser" method="POST" 
		modelAttribute="<%=ConstantsAdmin.USER_PERSON_EDIT_INFO_REQUEST_MODEL_KEY %>">
		
		
		<spring:hasBindErrors
			name="<%=ConstantsAdmin.USER_PERSON_EDIT_INFO_REQUEST_MODEL_KEY %>">
			<script type="text/javascript">
				$(document)
						.ready(
								function() {
									jAlert(
											'error',
											'<li><form:errors path="*" delimiter="<li>"/>',
											'<spring:message code="label.errormessage" />');
								});
			</script>
		</spring:hasBindErrors>
		
		<%
					if(request.getAttribute(ConstantsAdmin.SUCCESS_PARAM) != null) {
				%>
		<script type="text/javascript">
				$(document)
						.ready(
								function() { 
									jAlert(
											'success','<spring:message code="label.success.registerservice" />',
											'<spring:message code="msg.success" />');
								});
			</script>			
		<% }  %>
		
	<div id=accordion1>
   
		  		
		<fieldset><legend><spring:message code="label.login.details" /></legend></fieldset>
		 
	
	<div class="t_form-left">
	
	   <div class="fm-req">
	   
	        <form:label path="strUserName">
	        <span class="t_star">*</span>
		    <spring:message code="label.adminname.eng" />
	        </form:label> 
	        <form:input path="strUserName" id="strUserName" size="30" maxlength="100" />
	        
	   </div>
		
		
		
	   <div class="fm-req">
	   
	       <form:label path="strUserNameArab">
	       <span class="t_star">*</span>
		   <spring:message code="label.adminname.arab" />
	       </form:label> 
	       <form:input path="strUserNameArab" id="strUserNameArab" size="30" maxlength="100" />
	       
	  </div>	
	  
	
		 
		 <div class="fm-req">	
				
				    
					<form:label path="strUsrName" >
					<span class="t_star">*</span>
					  <spring:message code="label.username" />
					</form:label>
					<form:input  path="strUsrName" id="strUsrName" size="30" maxlength="100" readonly="true"/>	
				   
		</div>
		
			
	
		
			<div class="fm-req">	
				
				    
					<form:label path="strPassword" >
					<span class="t_star">*</span>
					  <spring:message code="label.password" />
					</form:label>
					<form:password path="strPassword" id="strPassword" size="30" maxlength="100" />	
				    
			</div>
		
		
		
		<div class="fm-req">	
				
				    
					<form:label path="strConfirmPassword" >
					<span class="t_star">*</span>
					  <spring:message code="label.confirmpassword" />
					</form:label>
					<form:password path="strConfirmPassword" id="strConfirmPassword" size="30" maxlength="100" />	
				    
		</div>
		
		
		
		<div class="fm-req">	
				
				    
					<form:label path="iSecretAnsId" >
					<span class="t_star">*</span>
					  <spring:message code="label.secretquestion" />
					</form:label>
					<c:choose>
					<c:when	test='${requestScope.requestContextAttribute.locale.language == "ar"}'>
						<form:select path="iSecretAnsId"
							items="${userSecretQuestion}"
							id="iSecretAnsId" itemLabel="labelAr" itemValue="id" class="fm-opt"/>
					</c:when>
					<c:otherwise>
						<form:select path="iSecretAnsId"
							items="${userSecretQuestion}"
							id="iSecretAnsId" itemLabel="labelEn" itemValue="id" class="fm-opt"/>
					</c:otherwise>
				</c:choose>		
				    
		</div>
		
		
		
		<div class="fm-req">	
				
				    
					<form:label path="strSecretAns" >
					<span class="t_star">*</span>
					  <spring:message code="label.anstosecretquestion" />
					</form:label>
					<form:input path="strSecretAns" id="strSecretAns" size="30" maxlength="100" />	
				    
		</div>
		
		
		
		<div class="fm-req">	
				
				    
					<form:label path="strEmail" >
					<span class="t_star">*</span>
					  <spring:message code="label.emailaddress" />
					</form:label>
					<form:input path="strEmail" id="strEmail" size="30" maxlength="100" />	
				    
		</div>
		
		
		
		<div class="fm-req">	
				
				    
					<form:label path="strMobile" >
					<span class="t_star">*</span>
					  <spring:message code="label.mobilenumber" />
					</form:label>
					<form:input path="strMobile" id="strMobile" size="30" maxlength="100" />	
				    
		</div>
	
		
		
		<div style="display:none;">
		
		
		<form:label path="strSmsNotification">
		<span class="t_star">*</span>
		<spring:message code="label.client.person.register.notifications" /></form:label>
		
		<div class="fm-multi">
						<spring:message code="label.emailnotification" /> 
						<form:checkbox	path="strSmsNotification" value="Y" id="strSmsNotification" class="opt-input"/> 
						<spring:message code="label.smsnotification" /> 
						<form:checkbox	path="strEmailNotification" value="Y" id="strEmailNotification" class="opt-input"/>
		</div>
	   </div>	
		
	  </div>	
	</div>	
		<div id="fm-submit" class="fm-req">
				<input type="submit" name="save" value="<spring:message code="label.button.save" />" class="t_btns save"/>		
				<input type="reset" name="reset" value="<spring:message code="label.button.reset" />" class="t_btns reset"/>
	  	</div>	
	</form:form>
</div>
	
